package com.buss.product.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name="base_goodsalias")
@TableGenerator(name="goodsalias_pk_sequence",initialValue=1,allocationSize=1,pkColumnName="seq_col",
		pkColumnValue="goodsalias_seq",valueColumnName="seq_val",table="product_pk_sequence")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class GoodsAlias  implements Serializable{
	

	private static final long serialVersionUID = 401896980016953746L;

	/**表主键*/
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="goodsalias_pk_sequence")
	private long id;
	
	/**商品信息*/
	@ManyToOne(cascade=CascadeType.REFRESH)
	@JoinColumn(nullable=false,name="goodsId",referencedColumnName="id")
	private Goods goods;
	
	/**别名名称*/
	@Column(length=200,nullable=false)
	private String aliasName;
	
	/**别名拼音全拼*/
	@Column(length=2000,nullable=false)
	private String pinyin;
	
	/**别名拼音简码*/
	@Column(length=200,nullable=false)
	private String pinyinHead;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public String getAliasName() {
		return aliasName;
	}

	public void setAliasName(String aliasName) {
		this.aliasName = aliasName;
	}

	public String getPinyin() {
		return pinyin;
	}

	public void setPinyin(String pinyin) {
		this.pinyin = pinyin;
	}

	public String getPinyinHead() {
		return pinyinHead;
	}

	public void setPinyinHead(String pinyinHead) {
		this.pinyinHead = pinyinHead;
	}
	
}
